package com.idealighter.game.core.dao.generate.mapper;

import com.idealighter.game.core.dao.generate.domain.MailDomain;
import com.idealighter.game.core.dao.generate.domain.MailDomainExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface MailDomainMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @SelectProvider(type=MailDomainSqlProvider.class, method="countByExample")
    long countByExample(MailDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @DeleteProvider(type=MailDomainSqlProvider.class, method="deleteByExample")
    int deleteByExample(MailDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @Delete({
        "delete from mail",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @Insert({
        "insert into mail (player_id, player_super_id, ",
        "player_name, from_player_id, ",
        "from_player_super_id, from_player_name, ",
        "gold, title, is_read, ",
        "is_rec_gold, create_time, ",
        "content)",
        "values (#{playerId,jdbcType=BIGINT}, #{playerSuperId,jdbcType=BIGINT}, ",
        "#{playerName,jdbcType=VARCHAR}, #{fromPlayerId,jdbcType=BIGINT}, ",
        "#{fromPlayerSuperId,jdbcType=BIGINT}, #{fromPlayerName,jdbcType=VARCHAR}, ",
        "#{gold,jdbcType=BIGINT}, #{title,jdbcType=VARCHAR}, #{isRead,jdbcType=BIT}, ",
        "#{isRecGold,jdbcType=BIT}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{content,jdbcType=LONGVARCHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(MailDomain record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @InsertProvider(type=MailDomainSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insertSelective(MailDomain record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @SelectProvider(type=MailDomainSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="player_id", property="playerId", jdbcType=JdbcType.BIGINT),
        @Result(column="player_super_id", property="playerSuperId", jdbcType=JdbcType.BIGINT),
        @Result(column="player_name", property="playerName", jdbcType=JdbcType.VARCHAR),
        @Result(column="from_player_id", property="fromPlayerId", jdbcType=JdbcType.BIGINT),
        @Result(column="from_player_super_id", property="fromPlayerSuperId", jdbcType=JdbcType.BIGINT),
        @Result(column="from_player_name", property="fromPlayerName", jdbcType=JdbcType.VARCHAR),
        @Result(column="gold", property="gold", jdbcType=JdbcType.BIGINT),
        @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_read", property="isRead", jdbcType=JdbcType.BIT),
        @Result(column="is_rec_gold", property="isRecGold", jdbcType=JdbcType.BIT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="content", property="content", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<MailDomain> selectByExampleWithBLOBs(MailDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @SelectProvider(type=MailDomainSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="player_id", property="playerId", jdbcType=JdbcType.BIGINT),
        @Result(column="player_super_id", property="playerSuperId", jdbcType=JdbcType.BIGINT),
        @Result(column="player_name", property="playerName", jdbcType=JdbcType.VARCHAR),
        @Result(column="from_player_id", property="fromPlayerId", jdbcType=JdbcType.BIGINT),
        @Result(column="from_player_super_id", property="fromPlayerSuperId", jdbcType=JdbcType.BIGINT),
        @Result(column="from_player_name", property="fromPlayerName", jdbcType=JdbcType.VARCHAR),
        @Result(column="gold", property="gold", jdbcType=JdbcType.BIGINT),
        @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_read", property="isRead", jdbcType=JdbcType.BIT),
        @Result(column="is_rec_gold", property="isRecGold", jdbcType=JdbcType.BIT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<MailDomain> selectByExample(MailDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @Select({
        "select",
        "id, player_id, player_super_id, player_name, from_player_id, from_player_super_id, ",
        "from_player_name, gold, title, is_read, is_rec_gold, create_time, content",
        "from mail",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="player_id", property="playerId", jdbcType=JdbcType.BIGINT),
        @Result(column="player_super_id", property="playerSuperId", jdbcType=JdbcType.BIGINT),
        @Result(column="player_name", property="playerName", jdbcType=JdbcType.VARCHAR),
        @Result(column="from_player_id", property="fromPlayerId", jdbcType=JdbcType.BIGINT),
        @Result(column="from_player_super_id", property="fromPlayerSuperId", jdbcType=JdbcType.BIGINT),
        @Result(column="from_player_name", property="fromPlayerName", jdbcType=JdbcType.VARCHAR),
        @Result(column="gold", property="gold", jdbcType=JdbcType.BIGINT),
        @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
        @Result(column="is_read", property="isRead", jdbcType=JdbcType.BIT),
        @Result(column="is_rec_gold", property="isRecGold", jdbcType=JdbcType.BIT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="content", property="content", jdbcType=JdbcType.LONGVARCHAR)
    })
    MailDomain selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @UpdateProvider(type=MailDomainSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") MailDomain record, @Param("example") MailDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @UpdateProvider(type=MailDomainSqlProvider.class, method="updateByExampleWithBLOBs")
    int updateByExampleWithBLOBs(@Param("record") MailDomain record, @Param("example") MailDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @UpdateProvider(type=MailDomainSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") MailDomain record, @Param("example") MailDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @UpdateProvider(type=MailDomainSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(MailDomain record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @Update({
        "update mail",
        "set player_id = #{playerId,jdbcType=BIGINT},",
          "player_super_id = #{playerSuperId,jdbcType=BIGINT},",
          "player_name = #{playerName,jdbcType=VARCHAR},",
          "from_player_id = #{fromPlayerId,jdbcType=BIGINT},",
          "from_player_super_id = #{fromPlayerSuperId,jdbcType=BIGINT},",
          "from_player_name = #{fromPlayerName,jdbcType=VARCHAR},",
          "gold = #{gold,jdbcType=BIGINT},",
          "title = #{title,jdbcType=VARCHAR},",
          "is_read = #{isRead,jdbcType=BIT},",
          "is_rec_gold = #{isRecGold,jdbcType=BIT},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "content = #{content,jdbcType=LONGVARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKeyWithBLOBs(MailDomain record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mail
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @Update({
        "update mail",
        "set player_id = #{playerId,jdbcType=BIGINT},",
          "player_super_id = #{playerSuperId,jdbcType=BIGINT},",
          "player_name = #{playerName,jdbcType=VARCHAR},",
          "from_player_id = #{fromPlayerId,jdbcType=BIGINT},",
          "from_player_super_id = #{fromPlayerSuperId,jdbcType=BIGINT},",
          "from_player_name = #{fromPlayerName,jdbcType=VARCHAR},",
          "gold = #{gold,jdbcType=BIGINT},",
          "title = #{title,jdbcType=VARCHAR},",
          "is_read = #{isRead,jdbcType=BIT},",
          "is_rec_gold = #{isRecGold,jdbcType=BIT},",
          "create_time = #{createTime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(MailDomain record);
}